package com.spring.autowiredAnnotation;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.spring.autowiredAnnotation.Boss;
public class UnitTest {

	private static ApplicationContext ctx;
	
	static {
		String[] locations = {"springAnnotationConfig/autowiredAnnotation.xml"};
		ctx = new ClassPathXmlApplicationContext(locations);
	}

	@Test
	public void test1() {
		Boss boss = (Boss) ctx.getBean("boss");
		System.out.println("[test1] " + boss);
	}
	
	@Test
	public void test2() {
		Boss1 boss1 = (Boss1) ctx.getBean("boss1");
		System.out.println("[test2] " + boss1);
	}
	
	@Test
	public void test3() {
		Boss2 boss2 = (Boss2) ctx.getBean("boss2");
		System.out.println("[test3] " + boss2);
	}
	
}
